<template>
  <div>

    <h2>业户经营许可证基础信息</h2>
  <span style="color: #d7d0d0"></span>
    <h5>
      查询指定数据：<input type="text" v-model="searchCondition" placeholder="请输入查询地址">
      <el-button type="primary" @click="selectcondition">点击查询</el-button>
    </h5>

    <el-table :data="businessoperationList" style="width: 100%" border empty-text="暂无数据" >

      <el-table-column prop="ADDR" label="地址" width="180" />

      <el-table-column prop="APPROVE" label="批准" width="180" />

      <el-table-column prop="BUSINATURE" label="商业性质" width="180" />

      <el-table-column label="操作">
        <template #default="scope">
          <el-button type="success" @click="test(scope.row)">查看详细</el-button>
        </template>
      </el-table-column>

    </el-table>

    <!--此处为弹窗-->
    <el-dialog v-model="dialogVisible" title="详细信息" width="30%">
      <div style="text-align: left">
        地址：{{onebusinessoperation.ADDR}}
        <br/>
        申请号：{{onebusinessoperation.APPNO}}
        <br/>
        审批：{{onebusinessoperation.APPROVE}}
        <br/>
        业务性质：{{onebusinessoperation.BUSINATURE}}
        <br/>
        业务范围：{{onebusinessoperation.BUSISCOPE}}
        <br/>
        卡开始日期：{{onebusinessoperation.CARDBEGINDATE}}
        <br/>
        卡结束日期：{{onebusinessoperation.CARDENDDATE}}
        <br/>
        负责人姓名：{{onebusinessoperation.CHARGERNAME}}
        <br/>
        客户ID：{{onebusinessoperation.CID}}
        <br/>
        房名：{{onebusinessoperation.HOUSNAME}}
        <br/>
        是否标志：{{onebusinessoperation.ISFLAG}}
        <br/>
        是否锁定：{{onebusinessoperation.ISLOCK}}
        <br/>
        许可证ID：{{onebusinessoperation.LICEID}}
        <br/>
        许可证号：{{onebusinessoperation.LICENO}}
        <br/>
        颁发日期：{{onebusinessoperation.LSSUDATE}}
        <br/>
        颁发单位名：{{onebusinessoperation.LSSUUNITNAME}}
        <br/>
        所有者ID：{{onebusinessoperation.OWNERID}}
        <br/>
      </div>
      <el-button  @click="addOne(onebusinessoperation)">
        点击添加
      </el-button>
    </el-dialog>
    <!--弹窗结束-->

  </div>
</template>

<script>
import axios from "axios"
import {ElMessage} from "element-plus";

export default {
  name: "BusinessoperationView",
  data(){
    return {
      businessoperationList:[], //后端接收数据集合的数组
      dialogVisible:false, //管理弹窗显示
      onebusinessoperation:{}, //查看那个对象
      searchCondition:"",//带到后端取的条件
    }
  },created() {
    axios("http://localhost:8000/consumerselect/businessoperation").then(
        (res)=>{
          this.businessoperationList = res.data;
          ElMessage.info("数据查询完成")
        }
    )
  },methods:{
    test(row){
      this.onebusinessoperation = row;
      this.dialogVisible = true;
    },
    selectcondition(){
      axios(`http://localhost:8000/consumerselect/businessoperation?addr=${this.searchCondition}`).then(
          (res)=>{
            this.businessoperationList = res.data
            ElMessage.info("条件查询完成")
          }
      )
    },
    addOne(row){
      console.log(row)
      alert("添加功能还未开放")
    }
  }

}
</script>

<style scoped>

</style>